USE [master]
GO

/****** Object:  Database [AcmeClaimsDatabase]    Script Date: 07/14/2014 15:18:37 ******/
IF  EXISTS (SELECT name FROM sys.databases WHERE name = N'AcmeClaimsDatabase')
DROP DATABASE [AcmeClaimsDatabase]
GO

USE [master]
GO

/****** Object:  Database [AcmeClaimsDatabase]    Script Date: 07/14/2014 15:19:51 ******/
CREATE DATABASE [AcmeClaimsDatabase] ON  PRIMARY 
( NAME = N'AcmeClaimsDatabase', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AcmeClaimsDatabase.mdf' , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'AcmeClaimsDatabase_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AcmeClaimsDatabase_log.ldf', MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [AcmeClaimsDatabase] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [AcmeClaimsDatabase].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [AcmeClaimsDatabase] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET ANSI_NULLS OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET ANSI_PADDING OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET ARITHABORT OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [AcmeClaimsDatabase] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [AcmeClaimsDatabase] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [AcmeClaimsDatabase] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET  DISABLE_BROKER
GO
ALTER DATABASE [AcmeClaimsDatabase] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [AcmeClaimsDatabase] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [AcmeClaimsDatabase] SET  READ_WRITE
GO
ALTER DATABASE [AcmeClaimsDatabase] SET RECOVERY SIMPLE
GO
ALTER DATABASE [AcmeClaimsDatabase] SET  MULTI_USER
GO
ALTER DATABASE [AcmeClaimsDatabase] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [AcmeClaimsDatabase] SET DB_CHAINING OFF
GO
USE [AcmeClaimsDatabase]
GO
/****** Object:  Table [dbo].[Users]    Script Date: 07/14/2014 15:19:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Users](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[enabled] [bit] NOT NULL,
	[username] [varchar](100) NOT NULL,
	[password] [varchar](100) NOT NULL,
	[fName] [varchar](25) NOT NULL,
	[lName] [varchar](25) NOT NULL,
	[gender] [varchar](10) NOT NULL,
	[SSN] [varchar](11) NOT NULL,
	[insuranceNumber] [varchar](12) NOT NULL,
	[birthday] [varchar](10) NOT NULL,
	[accessType] [varchar](20) NOT NULL,
 CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Claims]    Script Date: 07/14/2014 15:19:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Claims](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userId] [int] NOT NULL,
	[type] [varchar](30) NOT NULL,
	[date] [varchar](10) NOT NULL,
	[jobRelated] [bit] NOT NULL,
	[hospitalized] [bit] NOT NULL,
	[hospAdmitDate] [varchar](10) NULL,
	[hospDischargeDate] [varchar](10) NULL,
	[hospitalName] [varchar](30) NULL,
	[admittingPhysician] [varchar](70) NULL,
	[diagnosis] [varchar](300) NULL,
	[medicare] [bit] NOT NULL,
	[medicareNumber] [varchar](13) NULL,
	[medicareA] [bit] NOT NULL,
	[medicareB] [bit] NOT NULL,
	[otherInsurance] [bit] NOT NULL,
	[otherInsCompanyName] [varchar](70) NULL,
	[otherInsCompId] [int] NULL,
	[status] [varchar](20) NOT NULL,
	[eSignature] [bit] NOT NULL,
 CONSTRAINT [PK_Claim] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Authorities]    Script Date: 07/14/2014 15:19:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Authorities](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userId] [int] NOT NULL,
	[role] [varchar](50) NOT NULL,
 CONSTRAINT [PK_Authorities] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
